package com.m.interfaceDemo;

import com.m.polymorphic.IncomeAbstract;

public class ManuscriptImpl implements Income {
    private Double income;

    public ManuscriptImpl(Double income) {
        this.income = income;
    }

    /**
     * 稿费收入计税
     * @return
     */
    @Override
    public Double getTex(){
        if (this.income != null) {
            if (this.income < 4000 && this.income > 0) {
                return 800d;
            } else if (this.income > 4000) {
                return (this.income - 4000) * 0.14 + 800;
            }
        }
        return 0d;
    }


    public Double getIncome() {
        return this.income;
    }
}
